package com.kudian.restful.job;

import com.kudian.common.utils.DateUtils;
import com.kudian.restful.service.AccountStatementService;
import com.kudian.restful.service.OrderService;
import com.kudian.restful.vo.order.JobReceivingOrderVO;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.Date;

/**
 * Created by Administrator on 2016/8/9.
 */
public class QuartzJob {
    private static Logger log = Logger.getLogger(QuartzJob.class.getName());

    @Autowired
    private OrderService orderService;
    public void work() {
        log.info("Quartz的任务调度！！！");
        JobReceivingOrderVO vo = new JobReceivingOrderVO();
        String oneBefore = DateUtils.getBeforeDate(DateUtils.getSysTimestamp().getTime(), 24 * 2 * 60 * 60 * 1000L);
        vo.setDay(oneBefore);
        orderService.jobreceivingConfirmationSpeBySelf(vo);
        log.info("Quartz的任务调度！！！！！！");
    }

    public static void main(String[] args) {
        String oneBefore = DateUtils.getBeforeDate(DateUtils.getSysTimestamp().getTime(), 24 * 2 * 60 * 60 * 1000L);
        System.out.println(oneBefore);

        String d;
        d = DateUtils.dateFormat(new Date());
        d = d.substring(0, 10);
        System.out.println(d);
    }
}
